package edu.kit.aifb.lidasora.ppmModel.transitionCount;


/**
 * This class models a transition count
 * 
 * This class models a simple transition count. For each true prediction, the
 * count is incremented by one, otherwise decremented by a set value. This class
 * is NOT thread-safe.
 * 
 * @author Daniel
 * @see TransitionCount, ConcurrentWeightedDecrement
 */
public class WeightedDecrement extends TransitionCount {

	private double count = 1;
	private final double decrementValue;
	
	public WeightedDecrement(double decrementValue) {
		this.decrementValue = decrementValue;
	}
	
	/**
	 * {inheritDoc}
	 */
	@Override
	public void truePrediction() {
		count++;
	}

	/**
	 * {inheritDoc}
	 */
	@Override
	public void falsePrediction() {
		count-=decrementValue;

	}

	/**
	 * {inheritDoc}
	 */
	@Override
	public double getTransitionValue() {
		return count;
	}

	@Override
	public void reset(){
		count = 1;
	}
}
